import axios from 'axios';

/**
 * 获取生成的个人印章
 * @param sealForm
 * @returns {*}
 */
export const getPrivateSealApi = (sealForm) => axios({
    url: '/getPrivateSeal',
    method: 'post',
    data: sealForm
})

/**
 * 删除无用的图片
 * @param fileArray
 * @returns {AxiosPromise}
 */
export const deleteFileArrayApi = (fileArray) => axios({
    url: '/deleteFileArray',
    method: 'delete',
    params: {
        fileArray
    }
})

/**
 * 获取生成的企业印章
 * @param sealForm
 * @returns {AxiosPromise}
 */
export const getPublicSealApi = (sealForm) => axios({
    url: '/getPublicSeal',
    method: 'post',
    data: sealForm
})

/**
 * 新增印章详情
 * @param SealForm
 * @returns {AxiosPromise}
 */
export const addSealDetailApi = (SealForm) => axios({
    url: '/addSealDetail',
    method: 'post',
    data: SealForm
})

/**
 * 新增印章
 * @param SealForm
 * @returns {AxiosPromise}
 */
export const addSealApi = (SealForm) => axios({
    url: '/addSeal',
    method: 'post',
    data: SealForm
})

/**
 * 根据用户名获取印章列表
 * @param userId 用户id
 * @param current 当前页码
 * @param pageSize 分页大小
 * @return {AxiosPromise} 印章列表
 */
export const getSealByCreaterApi = (userId,current,pageSize) => axios({
    url: '/getSealByCreater',
    method: 'get',
    params: {
        userId,current,pageSize
    }
})

/**
 * 获取印章数量
 * @param userId 印章创建人
 * @return {AxiosPromise}
 */
export const getSealNumApi = (userId) => axios({
    url: '/getSealNum',
    method: 'get',
    params: {
        userId
    }
})

/**
 * 删除印章
 * @param sealId
 * @return {AxiosPromise}
 */
export const delSealApi = (sealId) => axios({
    url: '/delSeal',
    method: 'delete',
    params: {
        sealId
    }
})

/**
 * 生成具有盲水印的电子印章
 * @param Form
 * @returns {AxiosPromise}
 */
export const sealWatermarkApi = (Form) => axios({
    url: '/sealWatermark',
    method: 'post',
    data: Form
})

/**
 * 新增授权用户
 * @param AuthForm 授权用户信息
 * @return  {AxiosPromise}
 */
export const addSealAuthApi = (AuthForm) => axios({
    url: '/addSealAuth',
    method: 'post',
    data: AuthForm
})

/**
 * 根据印章id分页查询授权印章列表
 * @param current 当前页面
 * @param pageSize 分页大小
 * @param authSealId 授权印章id
 * @return {AxiosPromise}
 */
export const getSealAuthByIdApi = (current,pageSize,authSealId) => axios({
    url: '/getSealAuthById',
    method: 'get',
    params: {
        current,
        pageSize,
        authSealId
    }
})

/**
 * 根据id获取授权印章数量
 * @param authSealId 授权印章id
 * @return {AxiosPromise}
 */
export const getSealAuthNumBySealIdApi = (authSealId) => axios({
    url: '/getSealAuthNumBySealId',
    method: 'get',
    params: {
        authSealId
    }
})

/**
 * 根据用户 分页联查 被授权的印章 table[seal_con,seal_auth]
 * @param authSealId 被授权的用户
 * @return {AxiosPromise}
 */
export const getAuthSealApi = (current,pageSize,authSealUser) => axios({
    url: '/getAuthSeal',
    method: 'get',
    params: {
        current,
        pageSize,
        authSealUser
    }
})

/**
 * 获取被授权的印章的数量
 * @param authSealUser
 * @return {AxiosPromise}
 */
export const getAuthSealNumApi = (authSealUser) => axios({
    url: '/getAuthSealNum',
    method: 'get',
    params: {
        authSealUser
    }
})

/**
 * 根据uuid删除授权印章
 * @returns {AxiosPromise}
 */
export const delSealAuthApi = (uuid) => axios({
    url: '/delSealAuth',
    method: 'delete',
    params:{
        uuid
    }
})

/**
 * 更新授权信息
 * @param sealAuthFormAuth
 * @return {AxiosPromise}
 */
export const updateSealAuthApi = (sealAuthForm) => axios({
    url: '/updateSealAuth',
    method: 'put',
    data: sealAuthForm
})
